package com.huya.controller.user;

import com.huya.common.result.PageResult;
import com.huya.common.result.Result;
import com.huya.pojo.dto.TeacherPageQueryDTO;
import com.huya.pojo.entity.Teacher;
import com.huya.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userTeacherController")
@RequestMapping("/user/teacher")
@Slf4j
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    /**
     * 分页查询老师
     * @param teacherPageQueryDTO
     * @return
     */
    @GetMapping("/page")
    public Result<PageResult> page(TeacherPageQueryDTO teacherPageQueryDTO) {
        log.info("分页查询老师:{}", teacherPageQueryDTO);
        PageResult pageResult = teacherService.pageQuery(teacherPageQueryDTO);
        return Result.success(pageResult);
    }
}
